package com.gome.axwl.aoc.facade;

import com.gome.axwl.aoc.entity.dto.PageResultDto;
import com.gome.axwl.aoc.entity.exception.ZQException;
import com.gome.axwl.aoc.entity.po.BuildEmptyContractRequest;
import com.gome.axwl.aoc.entity.po.ContractPo;
import com.gome.axwl.aoc.entity.po.EmptyContractResponse;
import com.gome.commons.core.ResultData;

import java.util.Date;
import java.util.List;

/**
 * Created by wanglongyu on 2018/7/13.
 */
public interface ContractFacade {
    /***
     * 分页查询合同
     * @param contractName
     * @param status
     * @param startTime
     * @param endTime
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageResultDto<ContractPo> queryContract(String contractName, String contractNo,String carrierPhone,String carrierName,
                                            Integer status, Date startTime, Date endTime, Integer pageNum, Integer pageSize);

    /***
     * 获取合同图片详情
     * @param contractNo
     * @return
     */
    public List<String> getDetail(String contractNo) throws ZQException;

    /***
     * 下载合同
     * @param contractNo
     * @return
     */
    public String download(String contractNo) throws ZQException;

    /***
     * 提醒服务商签署合同
     * @param contractNo
     * @return
     */
    public Integer completionContract(String contractNo) throws ZQException;

    /***
     * 企业用户颁发数字证书
     * @param userCode 用户ID
     * @param name 企业名称
     * @param certificate 企业机构代码
     * @param address 企业注册地址
     * @param contact 企业联系人
     * @param phone 联系人电话
     * @return
     */
    public Integer entpReg(String userCode, String name, String certificate, String address, String contact, String phone) throws ZQException;

    /***
     * 个人用户颁发数字证书
     * @param userCode 用户id
     * @param name 姓名
     * @param idCardNo 身份证号
     * @param phone 电话
     * @return
     * @throws ZQException
     */
    public Integer personReg(String userCode, String name, String idCardNo ,String phone) throws ZQException;
    /***
     * 个人用户更新数字证书
     * @param userCode 用户id
     * @param name 姓名
     * @param idCardNo 身份证号
     * @param phone 电话
     * @return
     * @throws ZQException
     */
    public Integer personUpdate(String userCode, String name, String idCardNo ,String phone) throws ZQException;

    /***
     * 发短信提醒服务商
     * @param contractPhone
     * @param carrierName
     * @return
     */
    public ResultData remindCarrier(String contractPhone,String carrierName);

    /***
     * 骑缝章签署
     * @param no 合同编码
     * @param signers 当前合同需要签署的用户ID列表
     * @return
     */
    public Integer signCheckMark(String no, String signers) throws ZQException;
    /***
     * 后台自动签署
     * @param no 合同编码
     * @param signers 当前合同需要签署的用户ID列表
     * @return
     */
    public Integer signAuto(String no, String signers) throws ZQException;

    EmptyContractResponse getEmptyContract(Integer applyInfoId) throws ZQException;

    /***
     * 送签
     * @param request
     * @return
     * @throws ZQException
     */
    String buildEmptyContract(BuildEmptyContractRequest request) throws ZQException;

    Integer signByCarrier(Integer applyInfoId,String signName,String signJson) throws ZQException;

    /***
     * 运营中心签署合同
     * @param applyInfoId
     * @param auditStatus
     * @param signName
     * @param unpassReason
     * @return
     */
    Integer signByAoc(Integer applyInfoId,Integer auditStatus,String signName,String unpassReason) throws ZQException;
}
